<template>
    <div class="count">
        <h2>当前求和为:{{ sum }}</h2>
        <select v-model.number="Num">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
        </select>
        <button @click="increase">加</button>
        <button @click="decrease">减</button>
        
    </div>
</template>

<script lang='ts' setup name='count'>
import { ref } from 'vue';

/* 
    添加我们的求和数和我们加的数字
*/
let sum = ref(1)
let Num = ref(1)

function increase() {
    sum.value += Num.value
}
function decrease() {
    sum.value -= Num.value
}
</script>

<style scoped>
div.count {
    height: 100px;
    background-color: aquamarine;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
}

select,
button {
    margin: 0 5px;
    height: 30px;
}
</style>